import { lazy } from 'react'
import { Navigate } from "react-router-dom";
//================ 田豪杰
var Myserver = lazy(() => import('../views/Myserver.tsx'))
var Hot = lazy(() => import('../views/Myserver/Hot.tsx'))
var Bumen = lazy(() => import('../views/Myserver/Bumen.tsx'))
var Life = lazy(() => import('../views/Myserver/Life.tsx'))
var Zhuti = lazy(() => import('../views/Myserver/Zhuti.tsx'))
var Detail = lazy(() => import('../views/Myserver/Detail.tsx'))
var Login = lazy(() => import('../views/qLogin/Login.tsx'))
var Register = lazy(() => import('../views/qregister/Register.tsx'))
var Index = lazy(() => import('../views/Index/Index.tsx'))
var Main = lazy(() => import('../views/Main/Main.tsx'))
var Fuw = lazy(() => import('../views/Fwqd/Fuwu.tsx'))
//========================
var CorporateServices = lazy(() => import('../views/Fr/CorporateServices.tsx'))
var HeatClassification = lazy(() => import('../views/Fr/HeatClassification.tsx'))
var SubjectClassification = lazy(() => import('../views/Fr/SubjectClassification.tsx'))
var DepartmentClassification = lazy(() => import('../views/Fr/DepartmentClassification.tsx'))
var RunOnce = lazy(() => import('../views/Fr/RunOnce.tsx'))

export default [
  {
    path: '/index',
    element: <Index />,
    children: [
      // 个人服务路由
      {
        path: '/index/myse',
        element: <Myserver />,
        children: [
          {
            // 按热度
            path: '/index/myse/hot',
            element: <Hot />,
          },
          {
            // 按主题
            path: '/index/myse/zhuti',
            element: <Zhuti />,

          },
          {
            // 按部门
            path: '/index/myse/bumen',
            element: <Bumen />,

          },
          {
            // 按生命周期
            path: '/index/myse/life',
            element: <Life />,
          },
          {
            path: '/index/myse',
            element: <Navigate to="/index/myse/hot" />
          },
        ],
      },
      // 首页路由
      {
        path: '/index/main',
        element: <Main />,
      },
      // 服务清单
      {
        path: '/index/fuwu',
        element: <Fuw />,
      },
      // 法人服务
      {
        path: '/index/corporateServices',
        element: <CorporateServices />,
        children: [
          {
            path: '/index/corporateServices/heatClassification',
            element: <HeatClassification />,
          },
          {
            path: '/index/corporateServices/subjectClassification',
            element: <SubjectClassification />,
          },
          {
            path: '/index/corporateServices/departmentClassification',
            element: <DepartmentClassification />,
          },
          {
            path: '/index/corporateServices/runOnce',
            element: <RunOnce />,
          },
          {
            path: '/index/corporateServices',
            element: <Navigate to="/index/corporateServices/heatClassification" />
          },
          {
            path: '/index/corporateServices',
            element: <Navigate to="/index/corporateServices/heatClassification" />
          },
        ]
      },
      {
        path: '/index',
        element: <Navigate to="/index/main" />
      },
    ]
  },
  // 我的===============================================
  {
    path: '/detail/:id',
    element: <Detail />
  },
  {
    // 登录路由
    path: '/login',
    element: <Login />
  },
  {
    // 注册路由
    path: '/register',
    element: <Register />
  },
  {
    path: '/',
    element: <Navigate to="/index" />
  },
]